from rest_framework import viewsets
from rest_framework.decorators import action
from rest_framework.response import Response

from django.db.models import F, Count

from .models import EquipmentCategory
from .serializers import EquipmentCategorySerializer


class EquipmentCategoryViewSet(viewsets.ModelViewSet):
    '''
    list: 查询所有EquipmentCategory
    create: 新增EquipmentCategory
    retrieve: 查询单个EquipmentCategory, 文档名: read,接口名: retrieve
    update: 更新EquipmentCategory
    destroy: 删除EquipmentCategory
    '''
    queryset = EquipmentCategory.objects.all()
    serializer_class = EquipmentCategorySerializer
